#include <iostream>
#include <fmt/core.h>

using namespace std;
using namespace fmt;

template <class T>
void output(T[], int);

int main()
{
    int a[3] = {0, 1, 15};
    char buf[3] = {'a', 'b', 'c'};

    output(a, 3);
    output(buf, 3);

    string buf2;
    format_to(back_inserter(buf2), "{}", "Hello format !");
    cout << buf2 << endl;

    return 0;
}

template <class T>
void output(T vec[], int length)
{
    for (int i = 0; i < length; i++)
        cout << fmt::format("{:x} ", vec[i]);
    cout << endl;
}